<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/base.jsp"%>
<% 

	String id=request.getParameter("id");
	Money money=new Money(id);
	
	MoneyDao moneyDao = new MoneyDao();
	List<Money> list=moneyDao.findAll();
	String invo=list.get(0).getInvoicenumber();//按日期取最近的编号加一
	
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/admin.css">

<script type="text/javascript" src="third/laydate/laydate.js"></script>

<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		//重新绑定表单提交
		$("#add_btn").bind("click", function() {
			$('form').submit();
		});
	});
</script>

</head>

<body>

	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>参合登记</strong>
		</div>
		<div class="body-content">
			<form id="form-add" method="post" class="form-x"
				action="<%=path%>/system/MoneyServlet?m=edit">
				<%-- <div class="form-group" >
					<div class="label">
						<label>编号：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=money.getId() %>" name="id"
							data-validate="required:请输入登记人姓名" />
						<div class="tips"></div>
					</div>
				</div> --%>
				<div class="form-group">
					<div class="label">
						<label>登记人姓名：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=money.getName()%>" name="name"
							data-validate="required:请输入登记人姓名" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>是否设置标准：</label>
					</div>
					<div class="field" style="padding-top:8px;">
						是 <input name="standard" value="参照标准" type="radio" />
						 否 <input name="standard" value="无标准" type="radio" />

					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>已缴费：</label>
					</div>
					<div class="field" style="padding-top:8px;">
						是 <input name="pay" value="已缴费" type="radio" />
						 否 <input name="pay" value="未缴费" type="radio" />

					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>上次缴费时间：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=money.getLasttime() %>" name="lasttime" id="lasttime"
							data-validate="required:请输入上次缴费时间" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>有效年限：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=money.getEffectiveage() %>" name="effectiveage"
							data-validate="required:请输入有效年限" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>缴费金额：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=money.getAggregate() %>" name="aggregate"
							data-validate="required:请输入缴费金额" />
						<div class="tips"></div>
					</div>
				</div>
				
				<%if(money.getInvoicenumber()==null) {%>
				
				<%int one=1; %>
				<div class="form-group">
					<div class="label">
						<label>发票号：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=invo+one %>" name="invoicenumber" />
						<div class="tips"></div>
					</div>
				</div>
				<%}else{ %>
				<div class="form-group">
					<div class="label">
						<label>发票号：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=money.getInvoicenumber() %>" name="invoicenumber" />
						<div class="tips"></div>
					</div>
				</div>
				<%} %>
				<div class="form-group">
					<div class="label">
						<label>登记员：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=session.getAttribute("userid").toString() %>" name="operator"
							data-validate="required:请输入登记员" />
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button id="add_btn" class="button bg-main icon-check-square-o"
							type="button">提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	
<!--渲染JS日期组件 -->
<script type="text/javascript">
 laydate.render({
  elem: '#lasttime'
});
</script>
</body>
</html>
